<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <script type="text/javascript" src="/static/layui/layui.js"></script>
    <script type="text/javascript" src="http://hemin.cn/js/jquery.min.js"></script>
</head>
<body  class="layui-container">

<div class="layui-form"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
    <div class="layui-form-item">
        <label class="layui-form-label">添加小程序体验者:</label>
        <div class="layui-input-block">
            <input type="text" name="bindmember" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn"  lay-submit lay-filter="add">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</div>
<div class="layui-form"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
    <div class="layui-form-item">
        <label class="layui-form-label">清除小程序体验者:</label>
        <div class="layui-input-block">
            <input type="text" name="unmember" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn"  lay-submit lay-filter="unset">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</div>

<div class="layui-input-block">
    审核状态：{$getAudit}
</div>
<img height="200" width="200" src="{:url('home/Wxminiprogram/ExpVersion')}?appid={$appid}">

{if !empty($listmember)}
<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>人员对应的唯一字符串</th>
    </tr>
    </thead>
    <tbody>
    {volist name="$listmember" id="v"}
    <tr>
        {if !empty($v.userstr)}
        <td>
            人员对应的唯一id：{$v.userstr}
        </td>
        {/if}
    </tr>
    {/volist}
    </tbody>
</table>
{/if}
</body>

<script>
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(add)', function(data){
            var field = data.field.bindmember;
            $.post('home/Wxminiprogram/bindMember?appid={$appid}',{wechat:field},function(res){
                if(res){
                    layer.msg('设置成功');
                }else{
                    layer.msg('设置失败');
                }
            });
            return false;
        });
        form.on('submit(unset)', function(data){
            var field = data.field.unmember;
            $.post('home/Wxminiprogram/unBindMember?appid={$appid}',{wechat:field},function(res){
                if(res){
                    layer.msg('已删除')
                }else {
                    layer.msg('删除失败')
                }
            });

            return false;
        });
        //各种基于事件的操作，下面会有进一步介绍
    });
</script>
</html>